package com.gitee.wsl.ext.number


/**
 * Returns the sign of the number, as a char
 * @return either +, - or "" (empty string) if this is 0
 */
 val Int.signChar: String
    get() = when {
        this < 0 -> "-"
        this > 0 -> "+"
        else -> ""
    }

/**
 * Returns the sign of the number, as a char
 * @return either +, - or "" (empty string) if this is 0
 */
 val Float.signChar: String
    get() = when {
        this < 0f -> "-"
        this > 0f -> "+"
        else -> ""
    }

/**
 * Returns the sign of the number, as a char
 * @return either +, - or "" (empty string) if this is 0
 */
 val Double.signChar: String
    get() = when {
        this < 0.0 -> "-"
        this > 0.0 -> "+"
        else -> ""
    }

/**
 * Returns the sign of the number, as a char
 * @return either +, - or "" (empty string) if this is 0
 */
 val Long.signChar: String
    get() = when {
        this < 0L -> "-"
        this > 0L -> "+"
        else -> ""
    }